//
//  Analysis.h
//  CapAnalysis
//
//  Created by 李加建 on 2022/8/29.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface Analysis : NSObject

/// 使用指定配置初始化Bugly
/// @param appId appId
+ (void)startWithAppId:(NSString*)appId;

///---------------------------------------------------------------------------------------
///  友盟统计模块
///---------------------------------------------------------------------------------------

/// 初始化友盟所有组件产品
/// @param appKey 开发者在友盟官网申请的appkey.
/// @param channel 渠道标识，可设置nil表示"App Store".
+ (void)initWithAppkey:(NSString *)appKey channel:(NSString *)channel;

///---------------------------------------------------------------------------------------
///  推送模块
///---------------------------------------------------------------------------------------

/// 友盟推送的注册接口
/// @param launchOptions 系统的launchOptions启动消息参数用于处理用户通过消息打开应用相关信息。
/// @param complete  iOS10授权后的回调
+ (void)registerWithLaunchOptions:(NSDictionary * __nullable)launchOptions complete:(void (^ __nullable)(BOOL granted, NSError *_Nullable error))complete;

/// 向友盟注册该设备的deviceToken，便于发送Push消息
/// @param deviceToken APNs返回的deviceToken
+ (void)registerDeviceToken:( NSData * __nullable)deviceToken;

/// 应用处于运行时（前台、后台）的消息处理，回传点击数据
/// @param userInfo 消息参数
+ (void)didReceiveRemoteNotification:( NSDictionary * __nullable)userInfo;


+ (void)setAlias:(NSString * __nonnull )name type:(NSString * __nonnull)type response:(void (^__nonnull)(id __nullable responseObject,NSError * __nullable error))handle;

+ (void)removeAlias:(NSString * __nonnull)name type:(NSString * __nonnull)type response:(void (^__nonnull)(id __nullable responseObject, NSError * __nullable error))handle;

@end

NS_ASSUME_NONNULL_END
